package com.yshkj.payment.entity;

import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;

/**
 * 用户实体
 * Created by 唐旭 on 2016/9/7.
 */
@Entity
@Table
public class User extends BaseDomain implements UserInfo {
    @Column
    private String name;

    @OneToMany(cascade = CascadeType.ALL)
    @JoinColumn(name = "user")
    private Set<UserAccount> accountSet = new HashSet<>();

    public User() {
    }

    public String getName() {
        return name;
    }

    public User setName(String name) {
        this.name = name;
        return this;
    }

    @Override
    public Set<UserAccount> getUserAccountInfoSet() {
        return accountSet;
    }

    public Set<UserAccount> getAccountSet() {
        return accountSet;
    }

    public User setAccountSet(Set<UserAccount> accountSet) {
        this.accountSet = accountSet;
        return this;
    }
}
